﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE;

namespace DoxygenBrowserAddin.Controller
{
    public class AddInCommand
    {
        protected DoxAddinController _controller;
        protected string _strShortName;
        protected string _strButtonText;
        protected string _strToolTipText;
        protected int _iIconID;

        public AddInCommand(string strShortName,
                            DoxAddinController controller)
        {
            _strShortName = strShortName;
            _controller = controller;
            _strButtonText = strShortName;
            _strToolTipText = string.Empty;
            _iIconID = 0;
            _strHotKey = string.Empty;
        }

        public AddInCommand(string strShortName,
                            string strButtonText,
                            string strToolTipText,
                            int iIconID,
                            string strHotKey,
                            DoxAddinController controller)
        {
            _strShortName = strShortName;
            _strButtonText = strButtonText;
            _strToolTipText = strToolTipText;
            _iIconID = iIconID;
            _controller = controller;
            _strHotKey = strHotKey;
        }

        protected string _strHotKey;
        public string HotKey
        {
            get { return _strHotKey; }
            set { _strHotKey = value; }
        }

        public string ShortName
        {
            get { return _strShortName; }
        }

        public string CommandName { get { return _controller.AddInInstance.ProgID + "." + _strShortName; } }

        public string ButtonText
        {
            get { return _strButtonText; }
        }

        public string ToolTipText
        {
            get { return _strToolTipText; }
        }

        public int IconID
        {
            get { return _iIconID; }
        }

        public virtual bool Execute(vsCommandExecOption executeOption, ref object varIn, ref object varOut)
        {
            bool bHandled = true;
            return bHandled;
        }

        public virtual void QueryStatus(vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
        {
            status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
        }
    }
}
